package com.newdream.feigndemo.service;

import com.newdream.feigndemo.fallback.FeignFallBack;
import com.newdream.feigndemo.model.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @ author: sanglei
 * @ date: 2019-05-14 16:07
 * @ description: feignservice
 */
@Component
@FeignClient(name = "eurekaclient",fallback = FeignFallBack.class)
public interface FeignService {

    @GetMapping("get")
    public User getUser(@RequestParam("id") Integer id);
}
